/**
 * Description
 *
 * Creation Date 25/12/2017
 * @author Candy
 */
import React, { PureComponent } from 'react'
import PropTypes from 'prop-types';
import {
	StyleSheet,
	View,
	Image,
	TouchableHighlight,
	TouchableOpacity,
	Platform,
	FlatList,
	Text
} from 'react-native'
import Icon from 'react-native-vector-icons/Ionicons';
import { connect } from 'react-redux';
import { screen, color } from '../../utils';
import { ImageSwiper, TextTool } from '../../components';
import { getHomeBanner, categories, product } from '../../api';
import { setStore, getStore, removeStore } from '../../utils/tools';
import { InitCart, AddToCart, ReduceToCart, GoToPay, removeCart } from '../../redux/actions/rootActions';

class Payment extends PureComponent {
	static contextTypes = {
		store: PropTypes.any
	}

	constructor(props, context) {
		super(props, context)
	}

	render() {
		const { paymentList } = this.context.store.getState().cartReducers;
		console.log(paymentList)
		return (
			<View>
				<Text>Payment</Text>
			</View>
		)
	}
}
//连接reducer
export default connect((state) => {
	const { cartReducers } = state;  // 这里的beautyReducers注意和对应的reducer文件export的类相同
	return {
		cartReducers,
		cartList: cartReducers.cartList
	}
}, { InitCart })(Payment) // 这里是对应的存值的方法,导出当前模块
